<?php
/**
 * Description of _recent_appt
 * 
 * @author trongkhoi
 * @since Sep 17, 2013 - 10:33:19 AM
 */
?>
<div class="row-fluid">
    <div class="span2"></div>
    <div class="span10">
        <!--<h1><small>Recent Appointment</small></h1>-->
        <div class="row-fluid">
            <div class="box span6">
                <div class="box-header">
                    <h2><i class="icon-arrow-left"></i>Previous Appointment</h2>
                </div>
                <div class="box-content">
                    <?php if (Appoint::getPrevAppt($_GET['pk']) != FALSE): ?>
                        <?php
                        $max_appt  = Appoint::getPrevAppt($_GET['pk']);
                        $appt_prev = Appoint::model()->findByPk($max_appt['id']);
                        ?>
                        <table class="table table-bordered table-striped">
                            <tbody>
                                <tr>
                                    <td>Service</td>
                                    <td>
                                        <?php echo $appt_prev->service->s_name; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Start Time</td>
                                    <td>
                                        <?php echo $appt_prev->start_time; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>End Time</td>
                                    <td>
                                        <?php echo $appt_prev->end_time; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Date</td>
                                    <td>
                                        <?php echo date('d-M-Y', $appt_prev->date); ?>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    <?php else: ?>
                        <div class="alert alert-error">
                            No Appointment previous.
                        </div>
                    <?php endif; ?>
                </div>
            </div><!--/span-->
            <div class="box span6">
                <div class="box-header">
                    <h2><i class="icon-arrow-right"></i>Next Appointment</h2>
                </div>
                <div class="box-content">
                    <?php if (Appoint::getNextAppt($_GET['pk']) != FALSE): ?>
                        <?php
                        $min_appt  = Appoint::getNextAppt($_GET['pk']);
                        $appt_next = Appoint::model()->findByPk($min_appt['id']);
                        ?>
                        <table class="table table-bordered table-striped">
                            <tbody>
                                <tr>
                                    <td>Service</td>
                                    <td>
                                        <?php echo $appt_next->service->s_name; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Start Time</td>
                                    <td>
                                        <?php echo $appt_next->start_time; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>End Time</td>
                                    <td>
                                        <?php echo $appt_next->end_time; ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Date</td>
                                    <td>
                                        <?php echo date('d-M-Y', $appt_next->date); ?>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    <?php else: ?>
                        <div class="alert alert-error">
                            No Appointment next.
                        </div>
                    <?php endif; ?>
                </div>
            </div><!--/span-->
        </div>
    </div>
</div>